package com.edu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 教材采购表
 * @TableName textbook_purchase
 */
@TableName(value ="textbook_purchase")
@Data
public class TextbookPurchase {
    /**
     * 采购ID
     */
    @TableId(type = IdType.AUTO)
    private Long purchaseId;

    /**
     * 采购编号
     */
    private String purchaseCode;

    /**
     * 教材ID
     */
    private Long textbookId;

    /**
     * 供应商ID
     */
    private Long supplierId;

    /**
     * 采购数量
     */
    private Integer purchaseQuantity;

    /**
     * 单价
     */
    private BigDecimal unitPrice;

    /**
     * 总价
     */
    private BigDecimal totalPrice;

    /**
     * 采购日期
     */
    private Date purchaseDate;

    /**
     * 预计到货日期
     */
    private Date expectedArrivalDate;

    /**
     * 实际到货日期
     */
    private Date actualArrivalDate;

    /**
     * 状态
     */
    private Object status;

    /**
     * 接收人ID
     */
    private Long receiverId;

    /**
     * 质量检验状态
     */
    private Object qualityInspection;

    /**
     * 检验备注
     */
    private String inspectionNotes;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TextbookPurchase other = (TextbookPurchase) that;
        return (this.getPurchaseId() == null ? other.getPurchaseId() == null : this.getPurchaseId().equals(other.getPurchaseId()))
            && (this.getPurchaseCode() == null ? other.getPurchaseCode() == null : this.getPurchaseCode().equals(other.getPurchaseCode()))
            && (this.getTextbookId() == null ? other.getTextbookId() == null : this.getTextbookId().equals(other.getTextbookId()))
            && (this.getSupplierId() == null ? other.getSupplierId() == null : this.getSupplierId().equals(other.getSupplierId()))
            && (this.getPurchaseQuantity() == null ? other.getPurchaseQuantity() == null : this.getPurchaseQuantity().equals(other.getPurchaseQuantity()))
            && (this.getUnitPrice() == null ? other.getUnitPrice() == null : this.getUnitPrice().equals(other.getUnitPrice()))
            && (this.getTotalPrice() == null ? other.getTotalPrice() == null : this.getTotalPrice().equals(other.getTotalPrice()))
            && (this.getPurchaseDate() == null ? other.getPurchaseDate() == null : this.getPurchaseDate().equals(other.getPurchaseDate()))
            && (this.getExpectedArrivalDate() == null ? other.getExpectedArrivalDate() == null : this.getExpectedArrivalDate().equals(other.getExpectedArrivalDate()))
            && (this.getActualArrivalDate() == null ? other.getActualArrivalDate() == null : this.getActualArrivalDate().equals(other.getActualArrivalDate()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getReceiverId() == null ? other.getReceiverId() == null : this.getReceiverId().equals(other.getReceiverId()))
            && (this.getQualityInspection() == null ? other.getQualityInspection() == null : this.getQualityInspection().equals(other.getQualityInspection()))
            && (this.getInspectionNotes() == null ? other.getInspectionNotes() == null : this.getInspectionNotes().equals(other.getInspectionNotes()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPurchaseId() == null) ? 0 : getPurchaseId().hashCode());
        result = prime * result + ((getPurchaseCode() == null) ? 0 : getPurchaseCode().hashCode());
        result = prime * result + ((getTextbookId() == null) ? 0 : getTextbookId().hashCode());
        result = prime * result + ((getSupplierId() == null) ? 0 : getSupplierId().hashCode());
        result = prime * result + ((getPurchaseQuantity() == null) ? 0 : getPurchaseQuantity().hashCode());
        result = prime * result + ((getUnitPrice() == null) ? 0 : getUnitPrice().hashCode());
        result = prime * result + ((getTotalPrice() == null) ? 0 : getTotalPrice().hashCode());
        result = prime * result + ((getPurchaseDate() == null) ? 0 : getPurchaseDate().hashCode());
        result = prime * result + ((getExpectedArrivalDate() == null) ? 0 : getExpectedArrivalDate().hashCode());
        result = prime * result + ((getActualArrivalDate() == null) ? 0 : getActualArrivalDate().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getReceiverId() == null) ? 0 : getReceiverId().hashCode());
        result = prime * result + ((getQualityInspection() == null) ? 0 : getQualityInspection().hashCode());
        result = prime * result + ((getInspectionNotes() == null) ? 0 : getInspectionNotes().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", purchaseId=").append(purchaseId);
        sb.append(", purchaseCode=").append(purchaseCode);
        sb.append(", textbookId=").append(textbookId);
        sb.append(", supplierId=").append(supplierId);
        sb.append(", purchaseQuantity=").append(purchaseQuantity);
        sb.append(", unitPrice=").append(unitPrice);
        sb.append(", totalPrice=").append(totalPrice);
        sb.append(", purchaseDate=").append(purchaseDate);
        sb.append(", expectedArrivalDate=").append(expectedArrivalDate);
        sb.append(", actualArrivalDate=").append(actualArrivalDate);
        sb.append(", status=").append(status);
        sb.append(", receiverId=").append(receiverId);
        sb.append(", qualityInspection=").append(qualityInspection);
        sb.append(", inspectionNotes=").append(inspectionNotes);
        sb.append(", remark=").append(remark);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}